package com.blkbox.javaweb.listener;

import javax.servlet.ServletContextAttributeEvent;
import javax.servlet.ServletContextAttributeListener;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

public class MyApplicationListener implements ServletContextListener, ServletContextAttributeListener {

	public void attributeAdded(ServletContextAttributeEvent arg0) { 
        System.out.println("Application add new attribute: key="+arg0.getName()+"  value="+arg0.getValue());  

	}

	public void attributeRemoved(ServletContextAttributeEvent arg0) {
        System.out.println("Application remove new attribute: key="+arg0.getName()+"  value="+arg0.getValue());  

	}

	public void attributeReplaced(ServletContextAttributeEvent arg0) {
        System.out.println("Application replace new attribute: key="+arg0.getName()+"  value="+arg0.getValue());  

	}

	public void contextDestroyed(ServletContextEvent arg0) {
        System.out.println("Application Destroyed:"+arg0.getServletContext());  

	}

	public void contextInitialized(ServletContextEvent arg0) {
        System.out.println("Application Initialized:"+arg0.getServletContext());  

	}

}
